package com.usian.admin.controller;

import com.usian.admin.service.AdSensitiveService;
import com.usian.api.admin.SensitiveControllerApi;
import com.usian.model.admin.dtos.SensitiveDto;
import com.usian.model.admin.pojos.AdSensitive;
import com.usian.model.common.dtos.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.*;

@RequestMapping("api/v1/sensitive")
@RestController
public class SensitiveController implements SensitiveControllerApi {
    @Autowired
    AdSensitiveService adSensitiveService;
    @RequestMapping("list")
    public ResponseResult list(@RequestBody SensitiveDto sensitiveDto){
        return adSensitiveService.list(sensitiveDto);
    }

    @PostMapping("save")
    @Override
    public ResponseResult save(@RequestBody AdSensitive adSensitive) {
        return adSensitiveService.save(adSensitive);
    }
    @PostMapping("update")
    @Override
    public ResponseResult update(@RequestBody AdSensitive adSensitive) {
        return adSensitiveService.update(adSensitive);
    }
@DeleteMapping("del/{id}")
    @Override
    public ResponseResult deleteById(@PathVariable Integer id) {
        return adSensitiveService.deleteById(id);
    }

}
